package com.example.javabasic.thread.classone.completion;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import org.assertj.core.internal.Futures;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @description 测试监听线程
 * @Author Lin FuYuan
 * @date 2021/2/20
 */
public class TestListeningExecutorService {
    private Thread s;
    public static void main(String[] args) throws InterruptedException {


        Thread t2 = new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("xiancheng 2");

        });
        t2.start();
        t2.join();
        Thread.State state = t2.getState();
        System.out.println(state);
        System.out.println("over");



    }



    public void test(){
        s = Thread.currentThread();
        System.out.println("zhixing neirong ");
    }
}
